import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    typeid: '0',
    filterObj: {},
    goodsBrand: '',
    goodsTitle: '',
    goodsId: '',
    username: '',
    brandId: ''
  },
  actions: {
    // typeidChange: function (cxt, name) {
    //   cxt.commit('typeidChangeClick', name)
    // }
  },
  mutations: {
    typeidChangeClick: function (state, name) {
      state.typeid = name
    },
    filterObjFun: function (state, obj) {
      state.filterObj = obj
    },
    goodsBrandFun: function (state, name) {
      state.goodsBrand = name
    },
    goodsTitleFun: function (state, name) {
      state.goodsTitle = name
    },
    gooddIdFun: function (state, gid) {
      state.goodsId = gid
    },
    editUserName: function (state, gid) {
      state.username = gid
    },
    setBrandId: function (state, gid) {
      state.brandId = gid
    }
  }

})
